import os
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By

# 创建浏览器驱动, 并打开浏览器
driver = webdriver.Chrome()
driver.maximize_window()
driver.get(os.path.abspath("../练习页面/注册A.html"))

# 元素定位+元素操作
select_tag = driver.find_element(By.ID, "selectA")
select_tag.find_element(By.XPATH, "//option[3]").click()

# 滚动条操作
driver.execute_script("window.scrollTo(0,1000)")
sleep(3)
# 关闭浏览器
driver.quit()